type swaggerModel = {
    [key: string]: any
}


export let swaggerObjMap = new Map<string, swaggerModel>()


export function ApiModel(option: string) {
    return function (target: any) {
        const mapKey: string = target.name;
        let existModel = swaggerObjMap.get(mapKey);
        if (existModel === undefined) {
            existModel = {}
        }
        existModel['name'] = option
        swaggerObjMap.set(mapKey, existModel)

    }
}

export function ApiModelProperty(option: any) {
    return function (target: any, propertyKey: string) {
        const mapKey: string = target.constructor.name;
        let existModel = swaggerObjMap.get(mapKey);
        if (existModel === undefined) {
            existModel = {}
        }
        existModel[`field#${propertyKey}`] = option
        swaggerObjMap.set(mapKey, existModel)
    }
}